﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using OperaHouse.Domain.News;

namespace OperaHouse.Web.Models
{
    public class NewsItemModel
    {
        public int Id { get; set; }

        public string Title { get; set; }

        public string Short { get; set; }

        public string Full { get; set; }

        public bool Published { get; set; }

        public DateTime CreatedOn { get; set; }

        public static NewsItemModel Create(NewsItem news)
        {
            var newsModel = new NewsItemModel();
            newsModel.Id = news.Id;
            newsModel.Title = news.Title;
            newsModel.Short = news.Short;
            newsModel.Full = news.Full;
            newsModel.Published = news.Published;
            newsModel.CreatedOn = news.CreatedOn;
            return newsModel;
        }
    }
}